/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo9282;


import java.util.ArrayList;
import java.util.HashMap;
import javax.swing.JOptionPane;

/**
 *
 * @author Administrator
 */

public class HashMapDemo {
    public static void main(String args[]){
        //ArrayList<类名> 数组名=new ArrayList<类名>();
        
        HashMap<String,String> wordMap=new HashMap<String,String>();
         wordMap.put("hello", "你好");
         wordMap.put("world", "世界");
         wordMap.put("college", "学院");
         

         String word=JOptionPane.showInputDialog(null, "输入单词");
         JOptionPane.showMessageDialog(null, wordMap.get(word));
         
         
         
      
        
      
        
        
        
        
        
                
        
        
    }
    
}
